home *** CD-ROM | disk | FTP | other *** search
/ Enigma Amiga Life 109 / EnigmaAmiga109CD.iso / dalla rivista / host contacted / jikes.lha / jikes-1.11 / src / lookup.h < prev    next >
C/C++ Source or Header  |  2000-01-06  |  17KB  |  817 lines

  1. // $Id: lookup.h,v 1.15 2000/01/06 06:46:47 lord Exp $
  2. //
  3. // This software is subject to the terms of the IBM Jikes Compiler
  4. // License Agreement available at the following URL:
  5. // http://www.ibm.com/research/jikes.
  6. // Copyright (C) 1996, 1998, International Business Machines Corporation
  7. // and others.  All Rights Reserved.
  8. // You must accept the terms of that agreement to use this software.
  9. //
  10. #ifndef lookup_INCLUDED
  11. #define lookup_INCLUDED
  12.  
  13. #include "config.h"
  14. #ifdef HAVE_WCHAR_H
  15. # include <wchar.h>
  16. #endif
  17. #include <string.h>
  18. #include <sys/stat.h>
  19. #include <time.h>
  20. #include "tuple.h"
  21. #include "long.h"
  22. #include "double.h"
  23.  
  24. class Control;
  25. class Symbol;
  26. class PackageSymbol;
  27. class TypeSymbol;
  28. class MethodSymbol;
  29. class MethodShadowSymbol;
  30. class BlockSymbol;
  31. class VariableSymbol;
  32. class VariableShadowSymbol;
  33. class LabelSymbol;
  34. class LiteralSymbol;
  35. class NameSymbol;
  36.  
  37. class PathSymbol;
  38. class DirectorySymbol;
  39. class FileSymbol;
  40.  
  41. class ShadowSymbol;
  42.  
  43. class LiteralValue;
  44. class IntLiteralValue;
  45. class LongLiteralValue;
  46. class FloatLiteralValue;
  47. class DoubleLiteralValue;
  48. class Utf8LiteralValue;
  49.  
  50. class Utf8LiteralTable;
  51. class NameLookupTable;
  52. class TypeLookupTable;
  53. class LiteralLookupTable;
  54.  
  55. class AstBinaryExpression;
  56. class AstExpression;
  57.  
  58. class Hash
  59. {
  60. public:
  61.     //
  62.     // HASH takes as argument a pointer to a character string
  63.     // and its length which it hashes it into a location in the name
  64.     // hash table.
  65.     //
  66.     inline static unsigned Function(wchar_t *head, int len)
  67.     {
  68.         unsigned long hash_value = head[len >> 1]; // start with center (or unique) letter
  69.         wchar_t *tail = &head[len - 1];
  70.  
  71.         for (int i = 0; i < 5 && head < tail; i++)
  72.         {
  73.             unsigned k = *tail--;
  74.             hash_value += ((k << 7) + *head++);
  75.         }
  76.  
  77.         return hash_value;
  78.     }
  79.  
  80.     //
  81.     // Same as above function for a regular "char" string.
  82.     //
  83.     inline static unsigned Function(char *head, int len)
  84.     {
  85.         unsigned long hash_value = head[len >> 1]; // start with center (or unique) letter
  86.         char *tail = &head[len - 1];
  87.  
  88.         for (int i = 0; i < 5 && head < tail; i++)
  89.         {
  90.             unsigned k = *tail--;
  91.             hash_value += ((k << 7) + *head++);
  92.         }
  93.  
  94.         return hash_value;
  95.     }
  96.  
  97.     inline static unsigned Function(IEEEfloat value)
  98.     {
  99.         return value.Word();
  100.     }
  101.  
  102.     inline static unsigned Function(IEEEdouble value)
  103.     {
  104.         unsigned result = value.HighWord() + value.LowWord();
  105.         return result;
  106.     }
  107. };
  108.  
  109.  
  110. class DirectoryEntry
  111. {
  112. public:
  113.     DirectoryEntry *next;
  114.     char *name;
  115.     int length;
  116.  
  117.     DirectoryEntry() : next(NULL),
  118.                        name(NULL),
  119.                        length(0),
  120.                        directory(NULL),
  121.                        mtime_(0)
  122.     {
  123.         image = this;
  124.     }
  125.  
  126.     virtual ~DirectoryEntry()
  127.     {
  128.         delete [] name;
  129.     }
  130.  
  131.  
  132.     inline void Initialize(DirectorySymbol *directory_, char *name_, int length_)
  133.     {
  134.         directory = directory_;
  135.         length = length_;
  136.         name = new char[length + 1];
  137.         memmove(name, name_, length * sizeof(char));
  138.         name[length] = U_NULL;
  139.  
  140.         return;
  141.     }
  142.  
  143.     inline void Initialize(DirectoryEntry *entry, char *name_, int length_)
  144.     {
  145.         Initialize(entry -> directory, name_, length_);
  146.     }
  147.  
  148.     time_t Mtime();
  149.  
  150.     bool IsDummy() { return this != image; }
  151.  
  152.     //
  153.     // See FoldedDirectoryEntry for an explanation of the use of this function
  154.     //
  155.     virtual DirectoryEntry *Image() { return this; }
  156.  
  157. protected:
  158.     DirectorySymbol *directory;
  159.     DirectoryEntry *image;
  160.     time_t mtime_;
  161. };
  162.  
  163.  
  164. #ifdef WIN32_FILE_SYSTEM
  165. //
  166. // This object is needed only for systems such as Windows NT/95/98 that
  167. // treat filenames in a case-insensitive fashion.
  168. //
  169. class FoldedDirectoryEntry : public DirectoryEntry
  170. {
  171. public:
  172.     FoldedDirectoryEntry(DirectoryEntry *image_) { DirectoryEntry::image = image_; }
  173.     virtual ~FoldedDirectoryEntry() {}
  174.  
  175.     virtual DirectoryEntry *Image() { return image; }
  176. };
  177. #endif
  178.  
  179.  
  180. class SystemTable
  181. {
  182.     enum
  183.     {
  184.         DEFAULT_HASH_SIZE = 13,
  185.         MAX_HASH_SIZE = 1021
  186.     };
  187.  
  188. public:
  189.  
  190.     SystemTable(int = DEFAULT_HASH_SIZE);
  191.     virtual ~SystemTable();
  192.  
  193.     DirectorySymbol *FindDirectorySymbol(dev_t, ino_t);
  194.     void InsertDirectorySymbol(dev_t, ino_t, DirectorySymbol *);
  195.  
  196. private:
  197.     class Element
  198.     {
  199.     public:
  200.         Element(dev_t device_, ino_t inode_, DirectorySymbol *directory_symbol_) : device(device_),
  201.                                                                                    inode(inode_),
  202.                                                                                    directory_symbol(directory_symbol_)
  203.         {}
  204.  
  205.         Element *next;
  206.         dev_t device;
  207.         ino_t inode;
  208.         DirectorySymbol *directory_symbol;
  209.     };
  210.  
  211.     Tuple<Element *> directories;
  212.  
  213.     Element **base;
  214.     int hash_size;
  215.  
  216.     static int primes[];
  217.     int prime_index;
  218.  
  219.     int hash(dev_t device, ino_t inode) { return (device + inode) % hash_size; }
  220.  
  221.     void Rehash();
  222. };
  223.  
  224.  
  225. class DirectoryTable
  226. {
  227. public:
  228.     Tuple<DirectoryEntry *> entry_pool;
  229.  
  230.     DirectoryTable(int estimate = 1024);
  231.     ~DirectoryTable();
  232.  
  233.     DirectoryEntry *FindEntry(char *, int);
  234.     DirectoryEntry *InsertEntry(DirectorySymbol *, char *, int);
  235.  
  236. #ifdef WIN32_FILE_SYSTEM
  237.     //
  238.     // See FoldedDirectoryEntry for an explanation of the use of this function
  239.     //
  240.     DirectoryEntry *FindCaseInsensitiveEntry(char *, int);
  241.     void InsertCaseInsensitiveEntry(DirectoryEntry *);
  242. #endif
  243.  
  244. private:
  245.     enum
  246.     {
  247.         DEFAULT_HASH_SIZE = 1021,
  248.         MAX_HASH_SIZE = 8191
  249.     };
  250.  
  251.     DirectoryEntry **base;
  252.     int hash_size;
  253.  
  254.     static int primes[];
  255.     int prime_index;
  256.  
  257.     inline static unsigned Hash(char *head, int len) { return Hash::Function(head, len); }
  258.  
  259.     void Rehash();
  260. };
  261.  
  262.  
  263. class Symbol
  264. {
  265. public:
  266.     Symbol  *next;
  267.  
  268.     enum SymbolKind
  269.     {
  270.          NONE,
  271.          NAME,
  272.          PACKAGE,
  273.          TYPE, // class or interface
  274.          METHOD,
  275.          BLOCK,
  276.          VARIABLE,
  277.          LABEL,
  278.          LITERAL,
  279.  
  280.          PATH,
  281.          _DIRECTORY,
  282.          _FILE,
  283.  
  284.          _num_kinds
  285.     };
  286.  
  287.     SymbolKind Kind() { return _kind; }
  288.     virtual wchar_t *Name()   { return (wchar_t *) NULL; }
  289.     virtual size_t NameLength() { return 0; }
  290.     virtual NameSymbol *Identity() { return (NameSymbol *) NULL; }
  291.  
  292.     PackageSymbol        *PackageCast()        { return (PackageSymbol *) (_kind == PACKAGE ? this : NULL); }
  293.     TypeSymbol           *TypeCast()           { return (TypeSymbol *) (_kind == TYPE ? this : NULL); }
  294.     MethodSymbol         *MethodCast()         { return (MethodSymbol *) (_kind == METHOD ? this : NULL); }
  295.     BlockSymbol          *BlockCast()          { return (BlockSymbol *) (_kind == BLOCK ? this : NULL); }
  296.     VariableSymbol       *VariableCast()       { return (VariableSymbol *) (_kind == VARIABLE ? this : NULL); }
  297.     LabelSymbol          *LabelCast()          { return (LabelSymbol *) (_kind == LABEL ? this : NULL); }
  298.     LiteralSymbol        *LiteralCast()        { return (LiteralSymbol *) (_kind == LITERAL ? this : NULL); }
  299.     NameSymbol           *NameCast()           { return (NameSymbol *) (_kind == NAME ? this : NULL); }
  300.  
  301.     PathSymbol           *PathCast()           { return (PathSymbol *) (_kind == PATH ? this : NULL); }
  302.     DirectorySymbol      *DirectoryCast()      { return (DirectorySymbol *) (_kind == _DIRECTORY ? this : NULL); }
  303.     FileSymbol           *FileCast()           { return (FileSymbol *) (_kind == _FILE ? this : NULL); }
  304.  
  305.     virtual ~Symbol() {}
  306.  
  307. protected:
  308.     SymbolKind _kind;
  309. };
  310.  
  311.  
  312. class LiteralValue
  313. {
  314. public:
  315.     LiteralValue *next;
  316.     int index;
  317.  
  318.     virtual ~LiteralValue() {}
  319. };
  320.  
  321.  
  322. class IntLiteralValue : public LiteralValue
  323. {
  324. public:
  325.     int value;
  326.  
  327.     virtual ~IntLiteralValue() {}
  328.  
  329.     void Initialize(int value_, int index_)
  330.     {
  331.         value = value_;
  332.         index = index_;
  333.     }
  334. };
  335.  
  336.  
  337. class LongLiteralValue : public LiteralValue
  338. {
  339. public:
  340.     LongInt value;
  341.  
  342.     virtual ~LongLiteralValue() {}
  343.  
  344.     void Initialize(LongInt value_, int index_)
  345.     {
  346.         value = value_;
  347.         index = index_;
  348.     }
  349. };
  350.  
  351.  
  352. class FloatLiteralValue : public LiteralValue
  353. {
  354. public:
  355.     IEEEfloat value;
  356.  
  357.     virtual ~FloatLiteralValue() {}
  358.  
  359.     void Initialize(IEEEfloat value_, int index_)
  360.     {
  361.         value = value_;
  362.         index = index_;
  363.     }
  364. };
  365.  
  366.  
  367. class DoubleLiteralValue : public LiteralValue
  368. {
  369. public:
  370.     IEEEdouble value;
  371.  
  372.     virtual ~DoubleLiteralValue() {}
  373.  
  374.     void Initialize(IEEEdouble value_, int index_)
  375.     {
  376.         value = value_;
  377.         index = index_;
  378.     }
  379. };
  380.  
  381.  
  382. class Utf8LiteralValue : public LiteralValue
  383. {
  384. public:
  385.     char *value;
  386.     int  length;
  387.  
  388.     Utf8LiteralValue() : value(NULL)
  389.     {}
  390.  
  391.     virtual ~Utf8LiteralValue()
  392.     {
  393.         delete [] value;
  394.     }
  395.  
  396.     void Initialize(char *value_, int length_, unsigned hash_address_, int index_)
  397.     {
  398.         length = length_;
  399.         value = new char[length + 1];
  400.         memmove(value, value_, length * sizeof(char));
  401.         value[length] = U_NULL;
  402.  
  403.         hash_address = hash_address_;
  404.         index = index_;
  405.     }
  406.  
  407. private:
  408.  
  409.     friend class Utf8LiteralTable;
  410.  
  411.     unsigned hash_address;
  412. };
  413.  
  414.  
  415. class NameSymbol : public Symbol
  416. {
  417. public:
  418.     int index;
  419.     Utf8LiteralValue *Utf8_literal;
  420.  
  421.     virtual wchar_t *Name()   { return name_; }
  422.     virtual size_t NameLength() { return length; }
  423.     virtual NameSymbol *Identity() { return this; }
  424.     char *Utf8Name() { return (char *) (Utf8_literal ? Utf8_literal -> value : NULL); }
  425.     int Utf8NameLength() { return (Utf8_literal ? Utf8_literal -> length : 0); }
  426.  
  427.     NameSymbol() : name_(NULL)
  428.     {}
  429.  
  430.     virtual ~NameSymbol()
  431.     {
  432.         delete [] name_;
  433.     }
  434.  
  435.     inline void Initialize(wchar_t *str, int length_, unsigned hash_address_, int index_)
  436.     {
  437.         Symbol::_kind = NAME;
  438.  
  439.         hash_address = hash_address_;
  440.         index = index_;
  441.  
  442.         length = length_;
  443.         name_ = new wchar_t[length + 1];
  444.         memmove(name_, str, length * sizeof(wchar_t));
  445.         name_[length] = U_NULL;
  446.  
  447.         Utf8_literal = NULL;
  448.  
  449.         return;
  450.     }
  451.  
  452. private:
  453.  
  454.     friend class NameLookupTable;
  455.  
  456.     wchar_t *name_;
  457.     int length;
  458.     unsigned hash_address;
  459. };
  460.  
  461.  
  462. class NameLookupTable
  463. {
  464. public:
  465.     Tuple<NameSymbol *> symbol_pool;
  466.  
  467.     NameLookupTable(int estimate = 16384);
  468.     ~NameLookupTable();
  469.  
  470.     NameSymbol *FindOrInsertName(wchar_t *, size_t);
  471.  
  472. private:
  473.     enum
  474.     {
  475.         DEFAULT_HASH_SIZE = 4093,
  476.         MAX_HASH_SIZE = 32771
  477.     };
  478.  
  479.     NameSymbol **base;
  480.     int hash_size;
  481.  
  482.     static int primes[];
  483.     int prime_index;
  484.  
  485.     inline static unsigned Hash(wchar_t *head, int len) { return Hash::Function(head, len); }
  486.  
  487.     void Rehash();
  488. };
  489.  
  490.  
  491. class TypeLookupTable
  492. {
  493. public:
  494.     TypeLookupTable(int estimate = 16384);
  495.     ~TypeLookupTable();
  496.  
  497.     TypeSymbol *FindType(char *, int);
  498.     void InsertType(TypeSymbol *);
  499.     void SetEmpty();
  500.  
  501. private:
  502.     Tuple<TypeSymbol *> symbol_pool;
  503.  
  504.     enum
  505.     {
  506.         DEFAULT_HASH_SIZE = 4093,
  507.         MAX_HASH_SIZE = 32771
  508.     };
  509.  
  510.     TypeSymbol **base;
  511.     int hash_size;
  512.  
  513.     static int primes[];
  514.     int prime_index;
  515.  
  516.     inline static unsigned Hash(char *head, int len) { return Hash::Function(head, len); }
  517.  
  518.     void Rehash();
  519. };
  520.  
  521.  
  522. class LiteralSymbol : public Symbol
  523. {
  524. public:
  525.     LiteralValue *value;
  526.  
  527.     virtual wchar_t *Name()   { return name_; }
  528.     virtual size_t NameLength() { return length; }
  529.     virtual NameSymbol *Identity() { return (NameSymbol *) NULL; }
  530.  
  531.     LiteralSymbol() : name_(NULL)
  532.     {}
  533.  
  534.     virtual ~LiteralSymbol()
  535.     {
  536.         delete [] name_;
  537.     }
  538.  
  539.     void Initialize(wchar_t *str, unsigned hash_address_, int length_)
  540.     {
  541.         Symbol::_kind = LITERAL;
  542.  
  543.         hash_address = hash_address_;
  544.  
  545.         length = length_;
  546.         name_ = new wchar_t[length + 1];
  547.         memmove(name_, str, length * sizeof(wchar_t));
  548.         name_[length] = U_NULL;
  549.  
  550.         value = NULL;
  551.     }
  552.  
  553. private:
  554.  
  555.     friend class LiteralLookupTable;
  556.  
  557.     wchar_t *name_;
  558.     int length;
  559.     unsigned hash_address;
  560. };
  561.  
  562.  
  563. class LiteralLookupTable
  564. {
  565. public:
  566.     Tuple<LiteralSymbol *> symbol_pool;
  567.  
  568.     LiteralLookupTable();
  569.     ~LiteralLookupTable();
  570.  
  571.     LiteralSymbol *FindOrInsertLiteral(wchar_t *, size_t);
  572.  
  573. private:
  574.     enum
  575.     {
  576.         DEFAULT_HASH_SIZE = 1021,
  577.         MAX_HASH_SIZE = 8191
  578.     };
  579.  
  580.     LiteralSymbol **base;
  581.     int hash_size;
  582.  
  583.     static int primes[];
  584.     int prime_index;
  585.  
  586.     inline static unsigned Hash(wchar_t *head, int len) { return Hash::Function(head, len); }
  587.  
  588.     void Rehash();
  589. };
  590.  
  591.  
  592. class IntLiteralTable
  593. {
  594. public:
  595.     Tuple<IntLiteralValue *> symbol_pool;
  596.  
  597.     IntLiteralTable(LiteralValue *);
  598.     ~IntLiteralTable();
  599.  
  600.     LiteralValue *FindOrInsertNull()
  601.     {
  602.         return FindOrInsert(0);
  603.     }
  604.  
  605.     LiteralValue *FindOrInsertChar(LiteralSymbol *);
  606.     LiteralValue *FindOrInsertInt(LiteralSymbol *);
  607.     LiteralValue *FindOrInsertHexInt(LiteralSymbol *);
  608.     LiteralValue *FindOrInsertOctalInt(LiteralSymbol *);
  609.     LiteralValue *FindOrInsertNegativeInt(LiteralSymbol *);
  610.  
  611.     IntLiteralValue *FindOrInsert(int);
  612.     IntLiteralValue *Find(int);
  613.  
  614. #ifdef TEST
  615.     //
  616.     // To prevent arithmentic conversion to allow illegal calls inadvertently.
  617.     // Since the return type is wrong, compilation will fail !
  618.     //
  619.     void FindOrInsert(LongInt) {}
  620.     void FindOrInsert(float)   {}
  621.     void FindOrInsert(double)  {}
  622. #endif
  623.  
  624. private:
  625.     enum
  626.     {
  627.         DEFAULT_HASH_SIZE = 4093,
  628.         MAX_HASH_SIZE = 32771
  629.     };
  630.  
  631.     IntLiteralValue **base;
  632.     int hash_size;
  633.  
  634.     static int primes[];
  635.     int prime_index;
  636.  
  637.     static int int32_limit;
  638.  
  639.     LiteralValue *bad_value;
  640.  
  641.     void Rehash();
  642. };
  643.  
  644.  
  645. class LongLiteralTable
  646. {
  647. public:
  648.     Tuple<LongLiteralValue *> symbol_pool;
  649.  
  650.     LongLiteralTable(LiteralValue *);
  651.     ~LongLiteralTable();
  652.  
  653.     LiteralValue *FindOrInsertLong(LiteralSymbol *);
  654.     LiteralValue *FindOrInsertHexLong(LiteralSymbol *);
  655.     LiteralValue *FindOrInsertOctalLong(LiteralSymbol *);
  656.     LiteralValue *FindOrInsertNegativeLong(LiteralSymbol *);
  657.  
  658.     LongLiteralValue *FindOrInsert(LongInt);
  659.  
  660. #ifdef TEST
  661.     //
  662.     // To prevent arithmentic conversion to allow illegal calls inadvertently.
  663.     //
  664.     void FindOrInsert(int)    {}
  665.     void FindOrInsert(float)  {}
  666.     void FindOrInsert(double) {}
  667. #endif
  668.  
  669. private:
  670.  
  671.     enum
  672.     {
  673.         DEFAULT_HASH_SIZE = 1021,
  674.         MAX_HASH_SIZE = 8191
  675.     };
  676.  
  677.     LongLiteralValue **base;
  678.     int hash_size;
  679.  
  680.     static int primes[];
  681.     int prime_index;
  682.  
  683.     static LongInt int64_limit;
  684.  
  685.     LiteralValue *bad_value;
  686.  
  687.     void Rehash();
  688. };
  689.  
  690.  
  691. class FloatLiteralTable
  692. {
  693. public:
  694.     Tuple<FloatLiteralValue *> symbol_pool;
  695.  
  696.     FloatLiteralTable(LiteralValue *);
  697.     ~FloatLiteralTable();
  698.  
  699.     LiteralValue *FindOrInsertFloat(LiteralSymbol *);
  700.  
  701.     FloatLiteralValue *FindOrInsert(IEEEfloat);
  702.  
  703. #ifdef TEST
  704.     //
  705.     // To prevent arithmentic conversion to allow illegal calls inadvertently.
  706.     //
  707.     void FindOrInsert(int)     {}
  708.     void FindOrInsert(LongInt) {}
  709.     void FindOrInsert(double)  {}
  710. #endif
  711.  
  712. private:
  713.  
  714.     enum
  715.     {
  716.         DEFAULT_HASH_SIZE = 1021,
  717.         MAX_HASH_SIZE = 8191
  718.     };
  719.  
  720.     FloatLiteralValue **base;
  721.     int hash_size;
  722.  
  723.     static int primes[];
  724.     int prime_index;
  725.  
  726.     LiteralValue *bad_value;
  727.  
  728.     inline static unsigned Hash(IEEEfloat value) { return Hash::Function(value); }
  729.  
  730.     void Rehash();
  731. };
  732.  
  733.  
  734. class DoubleLiteralTable
  735. {
  736. public:
  737.     Tuple<DoubleLiteralValue *> symbol_pool;
  738.  
  739.     DoubleLiteralTable(LiteralValue *);
  740.     ~DoubleLiteralTable();
  741.  
  742.     LiteralValue *FindOrInsertDouble(LiteralSymbol *);
  743.  
  744.     DoubleLiteralValue *FindOrInsert(IEEEdouble);
  745.  
  746. #ifdef TEST
  747.     //
  748.     // To prevent arithmentic conversion to allow illegal calls inadvertently.
  749.     //
  750.     void FindOrInsert(int)     {}
  751.     void FindOrInsert(LongInt) {}
  752.     void FindOrInsert(float)   {}
  753. #endif
  754.  
  755. private:
  756.  
  757.     enum
  758.     {
  759.         DEFAULT_HASH_SIZE = 1021,
  760.         MAX_HASH_SIZE = 8191
  761.     };
  762.  
  763.     DoubleLiteralValue **base;
  764.     int hash_size;
  765.  
  766.     static int primes[];
  767.     int prime_index;
  768.  
  769.     LiteralValue *bad_value;
  770.  
  771.     inline static unsigned Hash(IEEEdouble value) { return Hash::Function(value); }
  772.  
  773.     void Rehash();
  774. };
  775.  
  776.  
  777. class Utf8LiteralTable
  778. {
  779. public:
  780.     Tuple<Utf8LiteralValue *> symbol_pool;
  781.  
  782.     Utf8LiteralTable(LiteralValue *);
  783.     ~Utf8LiteralTable();
  784.  
  785.     LiteralValue *FindOrInsertString(LiteralSymbol *);
  786.  
  787.     Utf8LiteralValue *FindOrInsert(char *, int);
  788.     Utf8LiteralValue *FindOrInsert(wchar_t);
  789.  
  790.     void CheckStringConstant(AstExpression *expr);
  791.  
  792. private:
  793.  
  794.     Tuple<AstExpression *> *expr;
  795.     void EvaluateConstant(AstExpression *, int, int);
  796.     bool IsConstant(AstExpression *);
  797.  
  798.     enum
  799.     {
  800.         DEFAULT_HASH_SIZE = 4093,
  801.         MAX_HASH_SIZE = 32771
  802.     };
  803.  
  804.     Utf8LiteralValue **base;
  805.     int hash_size;
  806.  
  807.     static int primes[];
  808.     int prime_index;
  809.  
  810.     LiteralValue *bad_value;
  811.  
  812.     inline static unsigned Hash(char *head, int len) { return Hash::Function(head, len); }
  813.  
  814.     void Rehash();
  815. };
  816. #endif
  817.